<template>
  <div class="header">
     <div class="title">
      <span>智能网联汽车大数据</span>
      <span>运控基础平台</span>
    </div>
    <div class="left">
      <img @click="skipToPortal" src="@/assets/images/back.png" />
      <span>首页</span>
      <div v-if="needShowAreaBtn" class="divider"></div>
      <span v-if="needShowAreaBtn" class="area" @click="shipToAreaPage">示范区</span>
    </div>
  </div>
</template>

<script setup>
const needShowAreaBtn = window.location.hash.startsWith('#/Synergy')
// 跳转到数据可视化总览页
const skipToPortal = () => {
  window.location.href = window.g.portalOverview;
};

const shipToAreaPage = () =>{
  window.location.href = window.g.portalArea;
}
</script>
<style lang="less" scoped>
.header {
  width: 100%;
  height: var(--headerHeight);
  background-image: url("@/assets/images/header.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 0 1.5rem;
  position: relative;
  .left {
    width: 100%;
    height: 3.625rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    z-index: 20;
  }

  .left > img {
    width: 1.5rem;
    height: 1.5rem;
    cursor: pointer;
  }

  .left > span {
    color: #55bfec;
    font-size: 1rem;
    margin-left: 0.375rem;
  }
  .title {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fcfeff;
    letter-spacing: 0.5rem;
    text-shadow: 0px 3px 3px rgba(255, 255, 255, 0.21);
    font-size: 1.625rem;
    font-family: PingFang SC-Semibold, PingFang SC;
    position: absolute;
    left: 0;
    top: 0;
    flex-direction: column;
    z-index: 11;
  }
}
.area {
  width: 7.5rem;
  height: 2.125rem;
  line-height: 2.125rem;
  box-shadow: 0px 0px 0.25rem 1px #585292, inset 0px 0px 0.625rem 1px #0f16a5;
  border-radius: 0.5rem 0.5rem 0.5rem 0.5rem;
  font-size: 1rem;
  opacity: 1;
  cursor: pointer;
  z-index: 100;
  color: white !important;
}
.divider {
  width: 1px;
  height: 1.375rem;
  border-left: 1px solid #49a9d2;
  margin: 0 1rem;
}
</style>
